package com.qiku.controller;

import com.qiku.annotation.SystemLog;
import com.qiku.entity.ResponseResult;
import com.qiku.entity.User;
import com.qiku.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/in")
    @SystemLog(businessName="认证登录")
    public ResponseResult login(@RequestBody User user){
        ResponseResult result = loginService.login(user);
        return result;
    }
    @PostMapping("/loginOut")
    public ResponseResult loginOut(){
        return loginService.loginOut();
    }
}
